﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master/MasterPage.master" AutoEventWireup="true"
    CodeFile="ManageUserAdvance.aspx.cs" Inherits="Admin_UserConfig_ManageUserAdvance" %>

<asp:Content ID="Content1" ContentPlaceHolderID="body" runat="Server">
    <div class="container">
        <div class="titlebg">
            <div class="title">
                用户管理</div>
        </div>
        <div class="content">
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <div>
                    用户名：<asp:TextBox ID="tbSearchUser" runat="server"></asp:TextBox>
                    <asp:Button ID="btnSearch"  runat="server" Text="搜索" />
                    </div>
                    <table style="width: 80%; margin-left: 20px; margin-top: 20px; padding: 10px;" class="userTable">
                        <tr>
                            <td valign="bottom" class="">
                                <asp:GridView ID="gvUserList" runat="server" AutoGenerateColumns="False" DataSourceID="ODSEList"
                                    class="List" OnRowUpdating="gvUserList_RowUpdating" DataKeyNames="Name" OnRowUpdated="gvUserList_RowUpdated"
                                    OnRowDeleting="gvUserList_RowDeleting" AllowPaging="True">
                                    <Columns>
                                        <asp:BoundField DataField="Name" HeaderText="登录名" ReadOnly="True" />
                                        <asp:TemplateField HeaderText="显示名称">
                                            <EditItemTemplate>
                                                <asp:TextBox ID="tbDisplayName" runat="server" Text='<%# Bind("DisplayName") %>'></asp:TextBox>
                                            </EditItemTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="Label3" runat="server" Text='<%# Bind("DisplayName") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="用户所属">
                                            <EditItemTemplate>
                                                <asp:RadioButtonList ID="rblUtypes" runat="server" RepeatDirection="Horizontal" SelectedIndex='<%# Eval("PType").ToString()=="0"?0:1 %>'>
                                                    <asp:ListItem Selected="True" Value="0">集团用户</asp:ListItem>
                                                    <asp:ListItem Value="1">城市公司用户</asp:ListItem>
                                                </asp:RadioButtonList>
                                            </EditItemTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="Label1" runat="server" Text='<%# Eval("PType").ToString()=="0"?"集团":"城市" %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="用户类型">
                                            <EditItemTemplate>
                                                <asp:DropDownList ID="ddlUType" runat="server" SelectedValue='<%# Eval("RWType").ToString() %>'>
                                                    <asp:ListItem Value="0">只读</asp:ListItem>
                                                    <asp:ListItem Value="1">读写</asp:ListItem>
                                                    <asp:ListItem Value="2">管理员</asp:ListItem>
                                                </asp:DropDownList>
                                            </EditItemTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="Label2" runat="server" Text='<%# GetUserType(Eval("RWType").ToString()) %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:CommandField ShowEditButton="True" />
                                        <asp:CommandField ShowDeleteButton="True" />
                                    </Columns>
                                    <EmptyDataTemplate>
                                        <table style="width: 100%">
                                            <tr>
                                                <td align="center">
                                                    当前没有相关用户
                                                </td>
                                            </tr>
                                        </table>
                                    </EmptyDataTemplate>
                                </asp:GridView>
                            </td>
                        </tr>
                        <tr>
                            <td valign="bottom" style="padding-top: 10px;">
                                <fieldset>
                                    <legend>添加用户</legend>
                                    <table style="width: 100%; margin-left: 10px;">
                                        <tr>
                                            <td style="width: 65px">
                                                关键字（拼音）：
                                            </td>
                                            <td>
                                                <asp:TextBox ID="tbName" runat="server" ValidationGroup="add" Height="24px"></asp:TextBox><asp:Button
                                                    ID="btnSearchUser" runat="server" Text="查找" 
                                                    onclick="btnSearchUser_Click" />                                            </td>
                                        </tr>
                                            <tr>
                                                <td style="width: 65px">
                                                用户：
                                                </td>
                                                <td>
                                                    <asp:DropDownList ID="ddlUserList" runat="server"   Width="300px" >
                                                    </asp:DropDownList>
                                                </td>
                                        </tr>
<%--                                        <tr>
                                            <td style="width: 65px">
                                                显示名： 
                                            </td>
                                            <td>
                                                <asp:TextBox ID="tbShowName" runat="server" Height="24px"></asp:TextBox>
                                            </td>
                                        </tr>--%>
                                        <tr>
                                            <td style="width: 65px">
                                                用户所属： 
                                            </td>
                                            <td>
                                                <asp:RadioButtonList ID="rblUtypesA" runat="server" Height="29px" 
                                                    RepeatDirection="Horizontal">
                                                    <asp:ListItem Value="0">集团用户</asp:ListItem>
                                                    <asp:ListItem Selected="True" Value="1">城市公司用户</asp:ListItem>
                                                </asp:RadioButtonList>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="width: 65px">
                                                用户类型： 
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="ddlUType0" runat="server" 
                                                    SelectedValue='<%# Eval("RWType").ToString() %>'>
                                                    <asp:ListItem Value="0">只读</asp:ListItem>
                                                    <asp:ListItem Value="1">读写</asp:ListItem>
                                                    <asp:ListItem Value="2">管理员</asp:ListItem>
                                                </asp:DropDownList>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="width: 65px">
                                                &nbsp;
                                            </td>
                                            <td>
                                                <asp:Button ID="btnAdd" runat="server" Height="41px" OnClick="btnAdd_Click" 
                                                    Text="添加" ValidationGroup="add" Width="108px" />
                                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                <asp:Label ID="lbResult" runat="server" ForeColor="#FF5050"></asp:Label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="width: 65px">
                                                &nbsp;
                                            </td>
                                            <td>
                                                &nbsp;
                                            </td>
                                        </tr>
                                        <caption>
                                            &nbsp;</caption>
                        </tr>
                                    </table>
                    <asp:ObjectDataSource ID="ODSEList" runat="server" SelectMethod="GetUserList" TypeName="PKURG.CostSplit.Business.Sys_Admin"
                        OldValuesParameterFormatString="original_{0}"></asp:ObjectDataSource>
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="script" runat="Server">
</asp:Content>
